<?php include '_init_.php';?>
<?php include 'page_header.php';?>
<div id="main"><!-- start #main //-->
<div id="tita"> <!-- start #tita //-->
<?php define('ORDER_NAVIGATOR_ITEM','基本資料查詢');?>
<?php include 'navigator_order_search.php';?>
<?php define('ORDER_MENU_CURRENT_ITEM','基本');?>
<?php include 'order_search_menu.php';?>
<?php

$act = isset($_REQUEST['act'])?$_REQUEST['act']:'';
$condition = isset($_REQUEST['condition'])?$_REQUEST['condition']:'';
if($act == 'search')
{
	$condition = '';
	if(strlen($_REQUEST['number']) > 0)
	{
		$condition .= sprintf("`order_number` like '%%%s%%' and",$_REQUEST['number']);
	}
	if(strlen($_REQUEST['customer_name']) > 0)
	{
		$condition .= sprintf("`c_name` = '%s' and",$_REQUEST['customer_name']);
	}
	if(strlen($_REQUEST['tel']) > 0)
	{
		$condition .= sprintf("(`c_tel` like '%%%s%%' or `c_mobile` like '%%%s%%') and",$_REQUEST['tel'],$_REQUEST['tel']);
	}
	if(strlen($_REQUEST['email']) > 0)
	{
		$condition .= sprintf("(`c_email` = '%s' or `c_email2` = '%s') and",$_REQUEST['email'],$_REQUEST['email']);
	}
	if(strlen($condition) > 0)
	{
		$condition = substr($condition,0,strlen($condition) - 4);
	}
}
?>
<form action="search.php">
<input type="hidden" name="act" value="search"/>
<div id="mainf" class="clearfix"><!-- start #maine //-->
<div class="mainf-3">
<ul>
      <li class="maine-1c">
       單號<input name="number" type="text" class="maine-keyink" value="<?php if(isset($_REQUEST['number'])){echo Util::html_safe($_REQUEST['number']);}?>"/></li>
       </ul>
   
     </div>
     <div class="mainf-3">
<ul>
      <li class="maine-1c">
       姓名<input name="customer_name" type="text" class="maine-keyink" value="<?php if(isset($_REQUEST['customer_name'])){echo Util::html_safe($_REQUEST['customer_name']);}?>"/></li>
       </ul>
   
     </div>
     <div class="mainf-3">
<ul>
      <li class="maine-1c">
       電話<input name="tel" type="text" class="maine-keyink" value="<?php if(isset($_REQUEST['tel'])){echo Util::html_safe($_REQUEST['tel']);}?>"/></li>
       </ul>
   
     </div>
     <div class="mainf-3">
<ul>
      <li class="maine-1b">
       電子郵件<input name="email" type="text" class="maine-keyinl" value="<?php if(isset($_REQUEST['email'])){ echo Util::html_safe($_REQUEST['email']);}?>"/></li>
       </ul>
   
     </div>
     <div class="mainf-4">
<ul>
     <li class="maina-1d"><a href="#" onclick="document.forms[0].submit();return false;"><img src="images/search-btn.gif" width="81" height="29" /></a></li>
   </ul>
     </div>
     </div><!-- end #maine //-->
     </form>
     <?php 
     if(isset($_REQUEST['act']) || isset($_REQUEST['p']))
     {
     	 include('search_list.php');
     }
     ?>
</div><!-- end #main //-->


</div><!-- end #all //-->

</body>
</html>